import sys
import time

import pygame

import base
import setting

pygame.init()
clock = pygame.time.Clock()
# 数据初始化
base.building_init()
base.chess_init()




# 窗口刷新
green_x = setting.chess_1_x0
green_y = setting.chess_1_y0
base.map_refresh()
setting.window.blit(setting.chess_1, base.chess[0]['place'])
setting.window.blit(setting.chess_2, base.chess[1]['place'])
pygame.display.flip()

# 窗口循环与退出
while True:  # 循环
    # if base.yon() is True:
    base.refresh()
    base.chess_move(0, base.roll())
    base.event(0, base.chess[0]['position'])

    time.sleep(1)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            sys.exit()
        elif event.type == pygame.MOUSEMOTION:
            print('鼠标移动')
